import { request } from 'umi';

export async function get(url: string, params: object) {
  // @ts-ignore
  return request(url, { method: 'GET', params });
}

export async function post(url: string, params: object) {
  // @ts-ignore
  return request(url, { method: 'POST', data: params });
}

export async function put(url: string, params: object) {
  // @ts-ignore
  return request(url, { method: 'PUT', data: params });
}

export async function del(url: string, params: object) {
  // @ts-ignore
  return request(url, { method: 'DELETE', params });
}

export async function postFile(url: string, params: object) {
  // @ts-ignore
  return request(url, { method: 'POST', data: params, requestType: 'form' });
}
